<?php
class Logo extends Controller {
	public function json() {
		$image = $this->post('image', 'str');
		$id = $this->post('id', 'int');
		
		if(!$image) $this->displayJSON(array('status' => -1, 'message' => '无图片地址'));
		if(!$id) $this->displayJSON(array('status' => -2, 'message' => '未知景点'));
		
		$mProduct = new Product_model();
		$params = array('image' => $image);
		$result = $mProduct->edit($id, $params);
		if($result) $this->displayJSON(array('status' => 0, 'message' => '设置景点图片成功'));
		else $this->displayJSON(array('status' => -3, 'message' => '设置景点图片失败'));
	}
}